﻿namespace WebServiceExtensions.LogExtension
{
	#region Namespaces

	using System;
	using System.Web.Services.Protocols;
	using System.Xml.Serialization;

    #endregion Namespaces

	/// <summary>
	///   Soap Message Details
	/// </summary>
	[Serializable]
	public class SoapMessageDetails
	{
		#region Properties (7) 

		/// <summary>
		///   Gets or sets the call count.
		/// </summary>
		/// <value>
		///   The call count.
		/// </value>
		[XmlElement(IsNullable = true)]
		public long? CallCount { get; set; }

		/// <summary>
		///   Gets or sets the type of the call.
		/// </summary>
		/// <value>
		///   The type of the call.
		/// </value>
        [XmlElement(IsNullable = true)]
		public CallType? CallType { get; set; }

		/// <summary>
		/// Gets or sets the type of the request.
		/// </summary>
		/// <value>
		/// The type of the request.
		/// </value>
		public SoapMessageLogType RequestType { get; set; }

		/// <summary>
		///   Gets or sets the service URL.
		/// </summary>
		/// <value>
		///   The service URL.
		/// </value>
        [XmlElement(IsNullable = true)]
        public string ServiceUrl { get; set; }

		/// <summary>
		///   Gets or sets the SOAP envelop.
		/// </summary>
		/// <value>
		///   The SOAP envelop.
		/// </value>
        [XmlElement(IsNullable = true)]
        public System.Xml.XmlDocument SoapEnvelop { get; set; }

		/// <summary>
		///   Gets or sets the headers.
		/// </summary>
		/// <value>
		///   The headers.
		/// </value>
        [XmlElement(IsNullable = true)]
		public SoapHeaderCollection SoapHeaders { get; set; }

		/// <summary>
		///   Gets or sets the SOAP version.
		/// </summary>
		/// <value>
		///   The SOAP version.
		/// </value>
        [XmlElement(IsNullable = true)]
        public string SoapVersion { get; set; }

		#endregion Properties 

		#region Methods (2) 

		// Public Methods (2) 

        /// <summary>
        /// Shoulds the serialize call count.
        /// </summary>
        /// <returns>true or false</returns>
        public bool ShouldSerializeCallCount()
        {
            return this.CallCount.HasValue;
        }

        /// <summary>
        /// Shoulds the serialize call count.
        /// </summary>
        /// <returns>true or false</returns>
        public bool ShouldSerializeCallType()
        {
            return this.CallType.HasValue;
        }

		#endregion Methods 
	}
}